package 简单工厂方法;

public class PolicyProducer {
    public static AutoInsurance getPolicyObj(String option) {
    	AutoInsurance policy =null;
    	if(option.compareTo("0")==0){policy= new BodyInjur();}
    	else if(option.compareTo("1")==0) {policy= new CarDam();}
    	else if(option.compareTo("2")==0) {policy= new PersonInjure();}
    	else if(option.compareTo("3")==0) {policy= new Com();}
    	return policy;
    }
}
